import React, { Component } from 'react';
import classnames from 'classnames';
import { Link } from 'react-router';
import { inject, observer } from 'mobx-react';
import { createForm } from 'rc-form';
import _ from 'lodash';
import Top from 'components/top'
import Ajax from 'lib/Ajax'

const pageName = 'zonePlan'
const Item = List.Item;

@inject('appStore', 'languageStore')
@observer
class ModuleName extends Component {
	constructor(props) {
    super(props);
    this.state = {
      getData: {}
    }
  }

  componentDidMount(){
    this.fetchData();
  }

  fetchData = () => {
    var self = this;
    Ajax({
      url: '/plan/get',
      data: {},
      success: function(result){
        self.setState({
          getData: result
        });
      },
      error: function(error){
        Toast.info(error||'请求失败');
      }
    });
  }

  render() {
    const pageData = this.props.languageStore.getPageData(pageName);
    const { planTime, countryId, educationId, nowGrade } = this.state.getData;
    return (
    	<div className={pageName}>
        <Top title={pageData.title}/>
        <List>
          <Item extra={this.props.appStore.getNameById('countryEn', countryId)}>意向国家</Item>
          <Item extra={this.props.appStore.getNameById('eductionTypeEn', educationId)}>申请学历</Item>
          <Item extra={planTime}>计划出国时间</Item>
          <Item extra={this.props.appStore.getNameById('nowGradeTypeEn', nowGrade)}>目前就读年级</Item>
        </List>
    	</div>
    )
  }
}


module.exports = ModuleName
